package server.business.controller;

import server.business.service.BloodOutboundService;
import server.business.vo.ResultExpand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author ccb
 * @date 2022/10/02
 */
@Controller
@RequestMapping("/bloodOutBound")
public class BloodOutboundController {
    
    @Autowired
    private BloodOutboundService bloodOutboundService;
    
//    @RequestMapping("/bloodOutbound")
//    public String toOutbound() {
//        return "pages/bloodOutbound";
//    }

    @RequestMapping("/normal/searchBloodOutBound")
    @ResponseBody
    public ResultExpand searchBloodInBound(HttpServletRequest request, HttpServletResponse response){
        ResultExpand resultExpand = new ResultExpand();
        resultExpand =  bloodOutboundService.searchBloodOutBound(request, response);
        return resultExpand;
    }

    @RequestMapping("/normal/downloadExcel")
    public void downloadExcel(HttpServletRequest request, HttpServletResponse response){
        bloodOutboundService.downloadExcel(request, response);
    }
}
